package com.itheima.service.impl;

import com.itheima.mapper.SifMapper;
import com.itheima.service.SifService;
import com.itheima.pojo.Sif;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class SifServiceImpl implements SifService {

    @Autowired
    private SifMapper sifMapper;
    @Override
    public void add(Sif sif) {
        sifMapper.add(sif);
    }

    @Override
    public List<Sif> findSifByTimeRange(LocalDateTime startTime, LocalDateTime endTime) {
        List<Sif> sifList= sifMapper.findSifByTimeRange(startTime,endTime);
        return sifList;
    }

    @Override
    public Sif findSifByTimestamp(LocalDateTime TimeStamp) {
        Sif sif = sifMapper.findSifByTimestamp(TimeStamp);
        return sif;
    }

    @Override
    public List<Sif> findSifInLatestDayData(){
        List<Sif> sifList = sifMapper.findSifInLatestDayData();
        return sifList;
    }

    @Override
    public Integer findSifAllNumber(){
        Integer sifNumber = sifMapper.findSifAllNumber();
        return sifNumber;
    }
}
